// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

#pragma once
#include "Orbit.h"
#include "vector.h"
#include <Ogre.h>
#include <string>
#include <vector>
#include "Body.h"
/*
class PhysBody
{
public:
	PhysBody(Orbit* _orbit, double _mass, double _radius);
	~PhysBody();
	void update(double jd);
	VECTOR position;
	VECTOR velocity;
	VECTOR tmpposition;
	VECTOR tmpvelocity;
	Orbit* orbit;
	double mass;
	double radius;
	HANDLE phys_mutex;
};

*/
#ifndef PI
#define PI 3.141592653589793238462643383279502884
#endif
#define Deg2Rad(x) (x*(double)PI/(double)180.)


class GravBody : public Body
{
public:
	GravBody(std::string _name, Body* _parent, Orbit* _orbit, double _mass, double _radius, double rotperiod = 23.9344694/24., double rotoffset = Deg2Rad(280.5), double rotinclination = Deg2Rad(-23.4392911), double rotnode = 0);
	~GravBody(void);
	virtual void update(void);
	//PhysBody* physBody;
	//VECTOR position;
	//VECTOR velocity;
	double radius;
	//double mass;
	Orbit* orbit;
	std::string name;
	//Ogre::SceneNode* node;
	Ogre::ManualObject* orbtrace;
	std::vector<VECTOR>* tracepoints;
	double rotperiod;
	double rotinclination;
	double rotnode;
	double rotepoch;
	double rotoffset;
	Ogre::SceneNode* rotsn;
	Ogre::MeshPtr sphere;
	Ogre::Entity* ent;
};
